(function(vvg){
   var EVENT_LISTENER_NAMES = [
      'initComponent'
      ,'beforeShow'
      ,'onShow'
      ,'afterShow'
      ,'onShowComplete'
      ,'onHide'
      ,'afterHide'
      ,'onRender'
      ,'afterRender'
      ,'onEnable'
      ,'onDisable'
      ,'onAdded'
      ,'onRemoved'
      ,'onResize'
      ,'onPosition'
      ,'onDestroy'
      ,'beforeDestroy'
      ,'afterSetPosition'
      ,'afterComponentLayout'
      ,'beforeComponentLayout'
   ];
   
   function logSize(msg, size) {
      console.log(msg + ': ' + size.width + ' x ' + size.height);
   }
   
   function genericEventListener(eventListenerName){
      return function() {
         logSize(eventListenerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(eventListenerName + ' pst parent', this.getSize());
      }
   }
   
   
   vvg.dbg = {
      addGenericEventListeners: function(target) {
         for(var i = 0; i < EVENT_LISTENER_NAMES.length; i++) {
            target[EVENT_LISTENER_NAMES[i]] = genericEventListener(EVENT_LISTENER_NAMES[i]);
         }
      }
   };
   
   Ext.define('VVG.dbg.GenericEventListeners', {
      initComponent: function() {
         var handlerName = 'initComponent';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,beforeShow: function() {
         var handlerName = 'beforeShow';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onShow: function() {
         var handlerName = 'onShow';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,afterShow: function() {
         var handlerName = 'afterShow';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onShowComplete: function() {
         var handlerName = 'onShowComplete';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onHide: function() {
         var handlerName = 'onHide';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,afterHide: function() {
         var handlerName = 'afterHide';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onRender: function() {
         var handlerName = 'onRender';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,afterRender: function() {
         var handlerName = 'afterRender';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onEnable: function() {
         var handlerName = 'onEnable';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onDisable: function() {
         var handlerName = 'onDisable';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onAdded: function() {
         var handlerName = 'onAdded';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onRemoved: function() {
         var handlerName = 'onRemoved';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onResize: function() {
         var handlerName = 'onResize';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onPosition: function() {
         var handlerName = 'onPosition';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,onDestroy: function() {
         var handlerName = 'onDestroy';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,beforeDestroy: function() {
         var handlerName = 'beforeDestroy';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,afterSetPosition: function() {
         var handlerName = 'afterSetPosition';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,afterComponentLayout: function() {
         var handlerName = 'afterComponentLayout';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
      ,beforeComponentLayout: function() {
         var handlerName = 'beforeComponentLayout';
         logSize(handlerName + ' pre parent', this.getSize());
         this.callParent(arguments);
         logSize(handlerName + ' pst parent', this.getSize());         
      }
   });
   
}(window.vvg = window.vvg || {}));